}
static ClutterContent *
-pixbuf_to_st_content_image (GdkPixbuf *pixbuf,
- CoglContext *context,
- int width,
- int height,
- int paint_scale,
- float resource_scale)
+pixbuf_to_st_content_image (GdkPixbuf *pixbuf,
+ CoglContext *context,
+ int width,
+ int height,
+ int paint_scale,
+ float resource_scale,
+ GError **error)
{
ClutterContent *image;
- g_autoptr(GError) error = NULL;
+ g_autoptr(GError) local_error = NULL;
float native_width, native_height;
gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf),
gdk_pixbuf_get_rowstride (pixbuf),
- &error);
+ &local_error);
- if (error)
+ if (local_error)
{
- g_warning ("Failed to allocate texture: %s", error->message);
+ g_propagate_error (error, g_steal_pointer (&local_error));
g_clear_object (&image);
}
if (!g_hash_table_lookup_extended (cache->keyed_cache, data->key,
&orig_key, &value))
{
+ g_autoptr (GError) error = NULL;
+
image = pixbuf_to_st_content_image (pixbuf,
data->cogl_context,
data->width, data->height,
data->paint_scale,
- data->resource_scale);
+ data->resource_scale,
+ &error);
if (!image)
- goto out;
+ {
+ g_warning ("Failed to load pixbuf into a content: %s",
+ error->message);
+ goto out;
+ }
g_hash_table_insert (cache->keyed_cache, g_strdup (data->key),
g_object_ref (image));
}
else
{
+ g_autoptr (GError) error = NULL;
+
image = pixbuf_to_st_content_image (pixbuf,
data->cogl_context,
data->width, data->height,
data->paint_scale,
- data->resource_scale);
+ data->resource_scale,
+ &error);
if (!image)
- goto out;
+ {
+ g_warning ("Failed to load pixbuf into a content: %s",
+ error->message);
+ goto out;
+ }
}
if (data->icon_info)
image = pixbuf_to_st_content_image (pixbuf, context,
available_height, available_width,
- paint_scale, resource_scale);
+ paint_scale, resource_scale,
+ error);
g_object_unref (pixbuf);
if (!image)